<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%--
  Created by IntelliJ IDEA.
  User: 13415372994
  Date: 2024/2/1
  Time: 11:36
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <style>
        * {
            margin: 0 auto;
        }
        * > h1{
            text-align: center;
        }
    </style>
</head>
<body>
<h1>修改页面</h1>
<form method="post" action="modify">
    <table border="1">
        <input type="hidden" name="carId" value="${car.carId}"/>

        <tr>
            <td>车名：</td>
            <td><input type="text" name="carName" value="${car.carName}"/></td>
        </tr>

        <tr>
            <td>车价(元)：</td>
            <td><input type="text" name="carPrice" value="${car.carPrice}"/></td>
        </tr>

        <tr>
            <td>里程：</td>
            <td><input type="text" name="carMileage" value="${car.carMileage}万公里"/></td>
        </tr>

        <tr>
            <td>购车时间：</td>
            <td><input type="text" name="carBuyTime"
                       value="<fmt:formatDate value='${car.carBuyTime}' pattern='yyyy-MM-dd'/>"/></td>
        </tr>

        <tr>
            <td>车型：</td>
            <td>
                <select name="carType">
                    <option value="1" ${car.carType eq '1' ? 'selected' : ''}>轿车</option>
                    <option value="2" ${car.carType eq '2' ? 'selected' : ''}>SUV</option>
                </select>
            </td>
        </tr>

        <tr>
            <td>状态：</td>
            <td>
                <input type="radio" name="carStatus" value="1" ${car.carStatus == 1 ? "checked":""}/>在售
                <input type="radio" name="carStatus" value="0" ${car.carStatus == 0 ? "checked":""}/>已售
            </td>
        </tr>

        <tr>
            <td>操作：</td>
            <td>
                <input type="submit" value="修改"/>
                <input type="button" value="返回" onclick="history.back()"/>
            </td>
        </tr>
    </table>
</form>
</body>
</html>
